perm filename SUBRS.DOC[SYS,HE]2 blob
sn#048181 filedate 1973-06-12 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00014 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00004 00002 PROCEDURES - ALINE : CALCOMP
C00007 00003 PROCEDURES - CLUPSC : EXPL
C00010 00004 PROCEDURES - FILESP : INTY
C00014 00005 PROCEDURES - ISIGN : KCSVCO
C00018 00006 PROCEDURES - LACT : LFDIF
C00021 00007 PROCEDURES - LINCHA : LISAVE
C00024 00008 PROCEDURES - LNFEAT : MALIN
C00027 00009 PROCEDURES - MAP : MLINES
C00030 00010 PROCEDURES - MSCVCO : PL
C00034 00011 PROCEDURES - PLDIS : REKOP
C00038 00012 PROCEDURES - RETCV : SVDIST
C00041 00013 PROCEDURES - TELL : XREF
C00044 00014 PROCEDURES - XREFC
C00098 ENDMK
C⊗;
PROCEDURES - ALINE : CALCOMP
PROC. DEF USED DESCRIPTION (* means code has been checked)
***********************************************************************
ALINE* SAIDIS SAIDIS Displays lines with optional windowing feature.
details of windowing not known but seens to keep
display inside limits of screen outside page print.
USED ONLY BY UPPDAT.
AMOD* FORSER LINE returns R mod S (??)
LINVER
MAPS1
MAPS2
ANGDIF* MAPS2 MAPS2 Returns least difference of1 angles p1 and p2
ignoring directions.
ANGDIR* LINE LINE finds angular direction from positive abscissa to
the vector p1,p2 in degrees
ANGLE* LINVER LINVER returns angle from vector (p1,p2) to vector (p3,p4)
ANGLEN* LINE LINE computes angle and length for a line
ANGLIN* LINVER PROT Returns least angle between lines (directions
MAPS1 ignored)
MAPS2
ANGSV* LINVEpR PROT Returns angle from s.v. p1 to s.v. p2 assuming their
lines are joined.
BELCRE* LINVER SCENE Returns first active line (else 0) for the c.v. p1.
SAIDIS Counts permanent connection only, iff p1>0.
PROT
MAPS1
BITS* SAISER GUNLO Returns bits p2 through p3 of p1, right adjusted
LINVER Bits ordered from right to left.
PROT
MAPS1
BUFPTR* SAIDIS SAIDIS Returns index+1 for word in DISBUF, to which DPYPTR
is currently pointing .USED ONLY BY DPY ROUTINES.
CALC* SAIDIS GUNLO Service routine for plotting displays. Outputs DPY
MAPS1 buffer to calcomp routine (part being displayed
MAPS2 only)
CALCOMP*SAIDIS SAIDIS Outputs display buffer p2 to disk file p1 in format
readable by Nealy Calcomp plotter program PLTVEC and
by Quam Video Synthesizer program MIRTOP.
USED ONLY BY DPY ROUTINES.
PROCEDURES - CLUPSC : EXPL
CLUPSC* MAPS1 MAPS1 Cleans up the scene after the isolation of a
complete or best partial. Removes to
(LCREDE=3000+CURMAP) all unused lies coinciding with
or contained within any line of the object.
COFEAT* PROT GUNLO Returns compound feature word for lines p1 and p2
PROT iff they share a c.v. (else 0). p3 and p4 refer
to entries in the feature table (from LFEAT).
They are negated (iff l.f. is ordered contrary to
line). FTREV←1 if C.F. ordered opposite of feature.
COMST* SAISER GUNLO shows and changes command strings (command editor)
CREPRO* PROT GUNLO Creates a prototype structure from a line-drawing
using the line-editor for the drawing part,
iff EDLIN≠0
DIRIND* SAIDIS SAIDIS indicates one of four quadrant, depending on p1 by
returning an integer in the range 1-4
USED ONLY BY DPY ROUTINES.
DISX* FORSER GUNLO transforms p1 from internal to display (X-coord)
SAIDIS
DISY* FORSER GUNLO transforms p1 from internal to display (Y-coord)
SAIDIS
DNEW* LINE LINE computes mean distance from projected line to new
point-pair. USED ONLY BY LINFIT.
DPSTR* SAIDIS SAIDIS Displays a string a (p1,p2) with windowing feature.
USED ONLY BY DPY ROUTINES.
DTRCE* MAPS1 MAPS1 Produces trace output on file "PARSE.TRC" if MAPREC
MAPS2 bit 12 is set.
EDREST* SAVRES GUNLO Inputs edge files. The extension, EDEXT,decides
format as follows:
.DAT Hueckel file
.EDG Pingle file
.SED sorted file
.TEM sorted temp file (no expansion exit)
EDSAVE* SAVRES GUNLO saves sorted edge-data on disk
EXPL* SAISER GUNLO Explodes word p1 into decimal parts, partitioned
after each position indicated by a bit in p2,
by the corresponding character in p3. Exploded
word will be surrounded by first and last
characters of p3.
PROCEDURES - FILESP : INTY
FILESP* SAVRES GUNLO Reads in file, ext, ppn, for line (p1=1), edge
(p1=2) , or prototype (p1=3) files.
FINDFT* PROT GUNLO Finds entry of p1, if any, in PFLST.
PROT Binary search. Automatically distinguishes between
l.f. and c.f. Returns 0 if p1=0. If not found,
returns negative of entry where feature should go
in table.
FPROPT* PROT PROT Returns location of PFPRO-word, containing reference
to prototype p2, assuming PFPTR at p1. Returns 0 if
no reference found.
FRAME* SAIDIS GUNLO Displays a frame around the scene
SAIDIS
FTEX* PROT GUNLO Extracts l.f.'s and c.f.'s over the active scene,
MAPS1 storing l.f.'s in LFEAT and c.f.'s in CFEAT
If PFTKEY true, extracts partially similar l.f.s.
FUSABL* MAPS1 MAPS2 Returns -1 (else 0) iff p2>0 and lines of s.v.'s p3
and p4 are collinear. If p2<0, checks whether line
of s.v. p1 may be extended through p3 (if p2=0) or
p4 (if p2=-1)
ICON* LINE LINE finds out whether two edge-pairs are in the same
connected set, and at a distance ≤p3 (number of
edge-pairs in between). USED ONLY BY LINFIT.
INITIA* SAISER GUNLO Initializes the line and vertex data structures
INREK* FORSER MAPS1 Returns true iff (p1,p2) is inside current
MAPS2 rectangular operator. Maps p1,p2 into coordinate
space using current transform and tests if
inside 2x2 cube centered on origin.
INSFT* PROT PROT Inserts the feature FEAT into ordered storage,
making sure there is a pointer back to prototype
p2. Feature id=address in the storage. Returns
address if successful (or feature already stored).
P4 contains l.f. equivalence class iff we are
dealing with an l.f. P3 is line number.
No-action returns: 0 if no free storage, -1 if p1=0
INTX* FORSER SAIDIS transforms p1 from display to internal (X coord)
USED ONLY BY DPY ROUTINES.
INTY* FORSER SAIDIS transforms p1 from display to internal (y coord)
USED ONLY BY DPY ROUTINES.
PROCEDURES - ISIGN : KCSVCO
ISIGN* FORSER LINVER Returns p1 with sign of p2
SCENE
SAIDIS
SAISER
PROT
MAPS2
KARN* FORSER LINE Finds intersection (p1,p2)-(p3,p4)⊗(p5,p6)-(p7,p8)
LINVER =(p9,p10). P11 or p12←1 (else 2) iff line 1 or 2 is
SCENE closer in slope to X-than to Y-axis. P13 or P14← end
SAIDIS on line 1 or 2, which is closest to (p9,p10).
PROT P13 or P14←1 or 2. P13 and P14 are negated iff
MAPS1 (p9,p10) is actually inside line-segment 1 or 2.
MAPS2 p15 and p16←squared distance from that end to
(p9,p10). P13 or P14←0 and P15 or p16←90000 iff
there is no intersection (slopes are too close).
If the lines are collinear (exception to last
sentance), and we ask for that case,
the center point between their close ends is
returned as the point of intersection (and other
parameters are set accordingly. p17 defines what
is to be done
=0 both cases are treated equally
=-1 looks for collinearities only.
=1 looks for intersection only.
KARN returns 0 iff lines are parallel, but not
collinear
-1 iff lines are collinar
1 iff lines intersect somewhere
-(1+N) iff line N (1 or 2) is gobbled by
line(2-N)
p18 is width for REKOP.
KOT* FORSER LINE computes tranformation matrix from internal
representation into coordinate system where
origin=(p1,p2), and the
new X- and Y-axes end at (p3,p4) and (p5,p6) (??)
KCSVCO* LINVER LINVER Returns 0, else number of obstructing s.v (signed),
if the s.v. p1 may be connected to the c.v. p2, or
if p2=0. Counts permanent connections only, iff
p1>0 else all. Counts only active lines iff p2>0,
else all. Uses line-coordinates in the decision.
A connection is impossible if the line would
overlap, or would shift over, any line at the c.v.
Returns LVOPP(P1), if that end is closer than p1 to
p2. Does not check for freedom of p1. Line is
moved to c.v. retaining angle. It is obstructed if
it intersected another line coming out of the c.v. ?
PROCEDURES - LACT : LFDIF
LACT* LINVER SCENE returns true iff line P1 is active
LINVER
SAIDIS
SAISER
PROT
MAPS1
MAPS2
LCOMCV* SCENE LINVER Returns number of common line, or 0 if none. Counts
SCENE all types and connections.
LCRL* MAPS1 LINVER Returns LCREDE entry for s.v. p1 (sign and low 4
MAPS1 digits only)
SAIDIS
MAPS2
LCRV* MAPS1 MAPS2 returns LCREDE entry for line P1 (sign and low 4
digits only)
LDIST* LINE SCENE measures distance (signed) from p1,p2 to line p3.
MAPS2
LEKV* LINE LINE finds the normalized line equation; ??
USED ONLY BY LINFIT.
LESSFT* PROT PROT Returns 0 iff p1=p2, 1 iff p1<p2, 2 iff p1>p2
MAPS2 Comparisons are made through appropriate masks
Similarity test for features.
LFDIF* MAPS1 GUNLO Returns encoded actions to be preformed at end p4
PROT of l.f. p2 in order to make it similar to end p3
MAPS2 of l.f. p1. Other ends must agree (otherwise
return='400). Program also sets the sequential
modification word MODIF, containing two bits for
each line-position at p4 of p2, telling what to
do at that position: (0=no change, 1=insert line,
2=delete line) MODIF←-1 if there is no
unambiguous modification possible. MODIF has its
high bit turned on iff end single before
insertions. The program pays no attention to the
outer angle at p4 of p2.
PROCEDURES - LINCHA : LISAVE
LINCHA* LINVER SAIDIS Always returns old LCREDE for line p1, unless p1≤0,
PROT for which case LINCHA←0. Depending on the signs of
p1 and p3 the following is done:
+ p2≠0 last on LCREDE-stack for p1 changed to p2
- " same for all lines
+ p2=0 deletes line p1
- " deletes all lines
0 ≠0 top of LCREDE for all lines with LCREDE=p2
changed to p3
0 0 Deletes all lines with LCREDE=p2
LINDEL* LINVER SAIDIS IF P2=0 the program returns line p1 to free storage.
MAPS1 Otherwise it changes item p1 on LCREDE-stack to p2.
LINVER
LINDL* MAPS1 MAPS1 line deletion with tracing.
MAPS2
LINED* SAIDIS GUNLO The line-editing program
PROT
LINFIT* LINE GUNLO responsible for the initial line fit. Fits lines in
as long successive segments as possible. Sets
LCREDE←LDATE. Deletes short lines, based on ILFL and
RMLG. Initializes vertices. Returns 0 when
everything ok, otherwise the number of the edge-pair
at which the overflow occured in line space.
Storage is assumed initialized.
LINSRT* LINVER SAIDIS Inserts a new line between (p3,p4) and (p5,p6),
LINVER connected to p1 and p2, respectively, and with
MAPS2 LCREDE←p7. New c.v. created for p1 or p2=0. C.v.
coordinates, if they exist, do not have to agree
with the given coordinates. For X-coords ≤0 the
c.v.-coords (X and Y) will be used. The connection
is made temporary for p1 or p2<0, else permanent.
Weighs only active lines at c.v's. Checks that
insertion is OK at c.v's iff p8≠0.
Returns line number or the following no-action
returns
0 iff length of line<.5
-1 iff line-space is exhausted
-3 iff the line could not be merged into one
of c.v.'s
LIREST* SAVRES GUNLO Restores data structure as saved by LISAVE
LISAVE* SAVRES GUNLO Save data structure on line-level
PROCEDURES - LNFEAT : MALIN
LNFEAT* PROT GUNLO Returns l.f. descriptor word for line p1, traversed
PROT in the positive direction. FTREV←1 if direction of
MAPS2 L.F. is opposite of line. ????
LSPLIT* LINVER SAIDIS Replaces line p1 by two lines, one from end 1 of p1
to (p2,p3), the other from (p2,p3) to end 2 of p1.
End links and LCREDE remain the same. New links
will be permanent. Returns middle c.v. (or 0 if
line-space is exhausted).
LVERPT* LINVER PROT Returns the s.v. (signed) whose LVER entry points
LINVER to the s.v. p1
counting only active lines iff p1>0, else both
kinds. Returns 0 if the line of p1 is dead, or p1>0
and the c.v. is inactive.
LVNEXT* LINVER LINE initializes to (and returns) the first s.v. (signed)
SCENE under the c.v. p1, iff p1≠0. If p1<0 inactive lines
MAPS2 are included throughout the process. If p1=0,
LINVER returns the S.V. (signed) pointed to next, and moves
the pointer. Temporary and permanent
connections are counted alike. Returns 0 iff the
c.v. does not exist, or p1>0 and the c.v. is
inactive, or all the s.v.s have been returned
already. P2 indicates which procedure is currently
calling this. We may have pointers in several
different verticies, from several procedures, at any
given time. P2 codes are: 1=NLINCV 2=LVERPT 3=KSCVCO
4=MSCVCO 5=MERCV 6=LINDEL 7=BELCRE 8=LCOMCV 9=WEIGHV
LVOPP* LINVER SCENE returns the S.V. opposite to the S.V. P1 (>0) on the
PROT same line
MAPS1
MAPS2
LINVER
MALI* LINE LINVER finds equation and other information for inserted
MAPS2 line p1
MALIN* LINE LINE stores various line characteristics in the initial
fit. USED ONLY BY LINFIT.
PROCEDURES - MAP : MLINES
MAP MAPS1 MAPS1 Sets up the expanded parallel data structure for
prototype PROT and initializes mapping arrays
according to the basic mapping provided by key
feature FEAT (c.f. or l.f.) from the scene into the
prototype. Then calls MAPREC to complete the
mapping, described in PLMAP (scene-line
corresponding to prot.-line) and in PVMAP
(scene-vertex corresponding to prot.-vertex)
MAPREC MAPS2 MAPS1 Builds up mapping as far as it can. True for
success.
MASKCF* PROT PROT Returns the c.f. word with the following bits
cleared: conv/div bits if || or collinearity bits
are on. Mask for similarity tests.
MASKLF* PROT PROT Returns the l.f. word with the following bits
cleared: lines~=180?, outside angle=180 and, if ||,
conv./div. Mask for similarity tests.
MAXLCR* PROT PROT Returns the maximal (but <1000) currently used
LCREDE in stack of any line.
MEDGE* SAIDIS SAIDIS Marks first visible 100 edge-pairs with optional
windowing
MERCV* LINVER SCENE Merges the c.v. with fewest members into the other
SAIDIS one, except if they share a common line, or if any
s.v. of one is not attachable to the other. Treats
all kind of lines and connections. Returns
resultant c.v. (or 0 for no action)
MLCR* MAPS1 MAPS2 Pushes p2 onto the LCREDE-stack for line p1
MAPS1
MLINES* SAIDIS SAIDIS Marks the active lines on the display with + or -
line #L in center of line, + in quad 1 or 2, Ln if
quad 1 or 4, nL if 2 or 3. USED ONLY IN DPY
ROUTINES.
PROCEDURES - MSCVCO : PL
MSCVCO* LINVER LINE Iff p3≠0, adds the s.v. p1 at c.v. p2 (temporarily
SAIDIS iff p1<0). Creates a new c.v. iff p2=0 and p1 is
LINVER free. Weighs only active lines, iff p2>0, else all.
Line-data is assumed existant. Does not check that
the junction is ok, iff p3>0, else it checks
(counting all lines and connections), and joins p1
to p2 iff everything ok. If p3=2, the c.v's are
single and the center point is used.
Iff p3=0∧p1<0, disconnects p1 from its c.v., leaving
it loose. Iff p3=0∧p1>0, temporizes the existing
connection, otherwise no change. May later update
ANGARG for the line. Returns 0 iff action could not
be completed. REturns 10000 iff p1 not free and
p3≠0. Returns number of obstructing s.v., if one
exists (for p3<0 only).
MVERT* SAIDIS SAIDIS Marks compound vertices of active lines on display
and numbers them. USED ONLY BY DPY ROUTINES.
NEXLIN* LINVER LINVER Returns and updates pointer to free line-storage.
USED ONLY BY LINE CHANGING ROUTINES.
NEXTSV* LINVER PROT Returns the p2nd s.v. (signed) under the c.v. of
LINVER s.v. p1, starting with p1. P2=0. Returns 0 if
MAPS2 there is no pointer, or if there are <(p2+1) s.v.'s.
Counts temporary connection iff p1<0.
NEXVER* LINVER LINVER returns and updates pointer to free C.V. storage
SCENE
MAPS1
NLINCV* LINVER SCENE returns number of active lines ending at p1
PROT (iff p1>0) If p1<0, inactive lines are counted as
LINVER well
NON0* FORSER FORSER If p1 very close to zero, returns a small non-zero
value with correct sign.
OPLPT* SAISER SAISER opens lpt if necessary onto a disk file NAME&NLPT&
".LPT" where NLPT is incremented by one for each
call
PARSE* MAPS1 GUNLO Attempts to find a stisfactory parsing of the scene.
Note that PARTS-storage implementation limits the
number of lines to 511
PL* SAISER SAISER Returns p1 preceded by enough p2's to make length=p3
SAVRES
PROCEDURES - PLDIS : REKOP
PLDIS* LINE SCENE finds the shortest squared distance p6, from point
SAIDIS p1,p2 to line p3, and the corresponding coordinates,
p4,p5, one the line. p7←1 (else 0) iff p4,p5 is
outside the line segment. Used in the insertion
package. Assumes the topological connectivity as
reflected in the line-coordinates. ???
PLEQV* PROT PROT Finds and stores l.f. equivalence classes for
prototype p1. Also find parallelity classes (and
stores in PLINE. This implementation of the
algorithm allows for at most 31 equivalence classes
and at most 8 lines per vertex.
PRECAL* SAIDIS GUNLO IB←number of display words currently in use.
MAPS1
PRREST* SAVRES GUNLO Restores prototype structure from dsk
PRSAVE* SAVRES GUNLO Stores current prototype data structure on dsk
QREAD* SAISER GUNLO inputs next string from COMSTR, dsk, or tty.
SAIDIS If ¬MODE gets TTY input. Otherwise, if COMSTR=0
PROT and command files are open, gets next string
SAVREV from pdl of open command files. If eof or brk=⊗
SAISER close and pop files and CMSAV pdl to COMSTR.
Otherwise scan COMSTR. Do until input found.
If none, return to ¬mode.
QRSET* SAISER GUNLO show and set real parameters (type in new value)
QSET* SAISER GUNLO show and set integer parameters
SAIDIS Type in new value.
QTRCE* MAPS1 MAPS2 Produces trace typeout and pauses if correct bit is
MAPS1 set in MAPTRC. Also puts out trace on dsk file if
bit 12 of MAPTRC is set.
REGREF* SAISER GUNLO prints main features of the data structure
REKOP* LINE FORSER sets up transform data from internal representation
MAPS1 into a rectangular operator with the line
MAPS2 (p1,p2)-(p3,p4) as axis, and of width p5. P6 returns
ratio of length of rectangle to width of rectangle.
The origin of this new coordinate system is
positioned at the center of gravity of the
rectangle. The new X-axis is directed to (p3,p4) and
the Y-axis goes out perpendicularly on the left.
PROCEDURES - RETCV : SVDIST
RETCV* LINVER LINVER returns C.V. p1 to free storage
SCENE
RETLIN* LINVER LINE Returns line p1 to free storage, zeroing relevant
LINVER area.
REVIVE* MAPS1 MAPS1 Pops LCREDE off top of stack, leaving next to newest
MAPS2 value
SAMECV* LINVER LINVER returns C.V. iff S.V. p1 and S.V. p2 are members
of the same C.V. else 0
SEDGE* SAIDIS SAIDIS Displays edge pairs, with optional windowing
SAISER USED ONLY BY DPY ROUTINES.
SETPAR* SAISER GUNLO parameter editor
SHARCV* LINVER PROT returns meeting ends (0 or 1) iff line p1 and p2
share a common vertex. Returns 0 otherwise.
1-p1=p2=0, 3-p1=0 p2=1, 5-p1=1 p2=0, 7-p1=p2=1
SHUFFL* SAISER GUNLO Shuffles the line-dimensioned data-space into a
SAVRES contiguous block at lower end of storage
(for save and/or expansions-contractions)
SIGN* FORSER FORSER Returns p1 with sign of p2
MAPS2
SKAR1* LINE SAIDIS finds intersection of (p1,p2)-(p3,p4) with line p5,
after (p1,p2) on the ray only. Returns point of
intersection (p6,p7), and distance from (p1,p2), p8.
SLINES* SAIDIS SAIDIS Displays line-drawing (only active lines)
USED ONLY BY DPY ROUTINES.
SORTED* LINE GUNLO sorts edge-pairs into connected subsets
SAVRES
SUMS* LINE LINE adds one or more edge pairs in the various sums for
the least square fit. Returns new mean square
deviation, if tolerable, else -100 ????
USED ONLY BY LINFIT.
SVDIST* LINVER PROT Returns order of p2 from p1 at common c.v. (0 if
none) Counts active lines only. Counts permanent
connections iff p1>0.
PROCEDURES - TELL : XREF
TELL* SAISER GUNLO types out ["&p1 if IWHAT is true (what program is
SAIDIS working on
PROT
SAVRES
SAISER
TTIN* SAISER SAISER inputs next string from tty. BRK=? flushes input
TRANSUP*SAIDIS GUNLO For updating display if case of changes is scale
and/or origin. Sets all POGs changed.
TRX* FORSER FORSER transforms internal (p1,p2) into new X-coord
based on last transformation matrix.
TRY* FORSER FORSER transforms internal (p1,p2) into new Y-coord
UNTELL* SAISER GUNLO types ] (end of what program is working on
SAIDIS if IWHAT
PROT
SAVRES
SAISER
UNXREF* SCENE GUNLO Disconnects all lines from each other (in x-ref.
MAPS1 tables)
UPDPTR* SAIDIS SAIDIS Updates DPYPTR before creating a pog to point to
start of its section of buffer and set first word
from DBRSI to turn on. USED ONLY BY DPY ROUTINES.
UPPDAL* MAPS1 MAPS1 Updates line-display and waits for a ":" iff p1 is
MAPS2 on
UPPDAT* SAIDIS GUNLO Updates the central display area, as necessary, and
PROT does DPYOUT if necessary.
MAPS1
WEIGHV* LINE LINVER computes weighted least-square coordinates (p2,p3)
MAPS1 and the weight (←sum of square roots of lengths of
MAPS2 lines involved), for the c.v. p1, also counting
SAIDIS inactive lines iff p1<0. If p1>'7777 then ICV is
interpreted as " number of lines" LSH 24 in the
array of line-numbers (verlin) ????
XREF* SCENE SAISER Sets up cress-reference tables, based on line
intersections, and uses those tables as a basis
for the creation of temporary compound verticies.
Those will later be utilized in the object
abstration schemes. Collinearities are also
recorded as midway-point intersections. The
program works only with active lines.
PROCEDURES - XREFC
XREFC* SAISER GUNLO calls XREF with auxilliary arrays. Prints tables iff
PROT p1 is on
MAPS1